package Lesson20.Exceptions;

public class Person 
{
	 String name;
	
	void setName (String name)
	{
		this.name = name;
	}
	
	boolean hasSameName(Person other) throws PersonException // the method MAY throw an exception
	{
			try
			{
				return this.name.equals(other.name);
			}
			
		catch(NullPointerException e)
		{
			throw new PersonException("Sorry :(", e); // what to throw!
		}
	}
}
